package TestSystemClient;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class ClientRules extends JFrame {

	private JPanel contentPane;
	private JPanel panel;
	private JPanel panel_1;
	private JPanel panel_2;
	private JLabel lblSinglePlay;
	private JLabel lblThereAre;
	private JLabel lblYouCan;
	private JLabel lblEasyQuestion;
	private JLabel lblPlayUntil;
	private JLabel lblMultiplay;
	private JLabel lblYouCan_1;
	private JLabel lblClickOn;
	private JLabel lblMaximun;
	private JLabel label;
	private JButton btnOk;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					ClientRules frame = new ClientRules();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public ClientRules() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 745, 496);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		panel = new JPanel();
		contentPane.add(panel, BorderLayout.CENTER);
		panel.setLayout(null);
		
		panel_1 = new JPanel();
		panel_1.setBorder(new TitledBorder(null, "How to play ?", TitledBorder.CENTER, TitledBorder.TOP, null, null));
		panel_1.setBounds(10, 11, 699, 426);
		panel.add(panel_1);
		panel_1.setLayout(new BorderLayout(0, 0));
		
		panel_2 = new JPanel();
		panel_1.add(panel_2, BorderLayout.CENTER);
		panel_2.setLayout(null);
		
		lblSinglePlay = new JLabel("Singleplay:");
		lblSinglePlay.setFont(new Font("Segoe Print", Font.BOLD, 15));
		lblSinglePlay.setBounds(27, 27, 96, 22);
		panel_2.add(lblSinglePlay);
		
		lblThereAre = new JLabel("- There are 3 levels for each question: Easy, Medium, Hard.");
		lblThereAre.setFont(new Font("Segoe Print", Font.PLAIN, 15));
		lblThereAre.setBounds(133, 27, 488, 22);
		panel_2.add(lblThereAre);
		
		lblYouCan = new JLabel("- You can chose which level you want to answer.");
		lblYouCan.setFont(new Font("Segoe Print", Font.PLAIN, 15));
		lblYouCan.setBounds(133, 60, 473, 22);
		panel_2.add(lblYouCan);
		
		lblEasyQuestion = new JLabel("- A true answer will have 5, 10, 15 points depent on question's level.");
		lblEasyQuestion.setFont(new Font("Segoe Print", Font.PLAIN, 15));
		lblEasyQuestion.setBounds(133, 93, 544, 22);
		panel_2.add(lblEasyQuestion);
		
		lblPlayUntil = new JLabel("- Game will stop when you chose a wrong answer.");
		lblPlayUntil.setFont(new Font("Segoe Print", Font.PLAIN, 15));
		lblPlayUntil.setBounds(133, 126, 432, 22);
		panel_2.add(lblPlayUntil);
		
		lblMultiplay = new JLabel("Multiplay:");
		lblMultiplay.setFont(new Font("Segoe Print", Font.BOLD, 15));
		lblMultiplay.setBounds(27, 212, 96, 22);
		panel_2.add(lblMultiplay);
		
		lblYouCan_1 = new JLabel("- You can invite others player to play.");
		lblYouCan_1.setFont(new Font("Segoe Print", Font.PLAIN, 15));
		lblYouCan_1.setBounds(133, 212, 381, 22);
		panel_2.add(lblYouCan_1);
		
		lblClickOn = new JLabel("- Click on player's name and Invite button, then wait to be accepted.");
		lblClickOn.setFont(new Font("Segoe Print", Font.PLAIN, 15));
		lblClickOn.setBounds(133, 245, 544, 22);
		panel_2.add(lblClickOn);
		
		lblMaximun = new JLabel("- Maximun 4 people can play together.");
		lblMaximun.setFont(new Font("Segoe Print", Font.PLAIN, 15));
		lblMaximun.setBounds(133, 278, 521, 22);
		panel_2.add(lblMaximun);
		
		label = new JLabel("- Each queston had 60s to answer, and 10s to change question.");
		label.setFont(new Font("Segoe Print", Font.PLAIN, 15));
		label.setBounds(133, 311, 544, 22);
		panel_2.add(label);
		
		btnOk = new JButton("OK");
		btnOk.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ClientRules.this.dispose();
			}
		});
		btnOk.setFont(new Font("Segoe Print", Font.PLAIN, 15));
		btnOk.setBounds(306, 344, 89, 32);
		panel_2.add(btnOk);
	}
}
